package rudy.elevator.thread;

import rudy.elevator.bean.LiftBean;
import rudy.elevator.ui.MainPanel;

public class UpThread extends Thread{
    LiftBean lift;
    MainPanel panel;
    int  level =1;
    public UpThread(LiftBean lift, MainPanel panel) {
        this.lift = lift;
        this.panel = panel;
    }

    public void setLever(int level)
    {
       level = this.level;
    }
    public void run()
    {
      doUp();
    }


    public void doUp()
    {

        for (int i = 0; i < lift.getFlowerhight(); i++) {
            lift.setUp();
            try {
                Thread.sleep(5);
            } catch (InterruptedException ex) {
            }
            panel.repaint();

        }

    }
}
